fix: add conditional output handling for optional Bicep module references#43
Open
justinyoo wants to merge 1 commit intoAzure-Samples:mainfrom
Open
fix: add conditional output handling for optional Bicep module references#43justinyoo wants to merge 1 commit intoAzure-Samples:mainfrom
justinyoo wants to merge 1 commit intoAzure-Samples:mainfrom
Conversation
…nces Use the non-null assertion operator (!) for conditional module outputs and guard output expressions with empty-string fallbacks when upstream AI services or project parameters are not provided. Files changed: - infra/core/ai/ai-project.bicep - infra/core/host/acr.bicep - infra/core/search/bing_custom_grounding.bicep - infra/core/search/bing_grounding.bicep - infra/core/storage/storage.bicep Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
!) on conditional module outputs to satisfy the compiler when accessing.outputson modules guarded byifconditions.!empty()checks and empty-string fallbacks so that outputs resolve safely when upstream AI services or project parameters are not provided.concat()pattern to conditionally include the AI project service principal only when AI services are configured.Files changed
infra/core/ai/ai-project.bicep– non-null assertions onapplicationInsightsmodule outputsinfra/core/host/acr.bicep– conditional role assignments and connection outputinfra/core/search/bing_custom_grounding.bicep– conditional connection outputsinfra/core/search/bing_grounding.bicep– conditional connection outputsinfra/core/storage/storage.bicep– conditional connection outputDoes this introduce a breaking change?
Pull Request Type
What kind of change does this Pull Request introduce?
How to Test
git clone https://github.com/justinyoo/azd-ai-starter-basic.git cd azd-ai-starter-basic git checkout hotfix/conditional-outputsWhat to Check
Verify that the following are valid
Other Information